<template>
    <div class="wrapper" ref="wrapper">
        <div class="content">
            <slot></slot>
        </div>
    </div>
</template>

<script>
import BScroll from 'better-scroll';
    export default {
        data() {
            return {
                scroll: null
            }
        },
        props: {
            probeType: {
                type: Number,
                default: 0
            },
            pullUpload:{
                type:Boolean,
                default:false,
            }
        },
        mounted () {
            this.scroll = new BScroll(this.$refs.wrapper,{
                click:true,
                probeType:this.probeType,
                pullUpLoad:this.pullUpload,
            });
            // 监听上拉事件
            this.scroll.on('pullingUp',()=>{
                // 上拉加载更多
                this.$emit('pullingUp');
                this.scroll.finishPullUp()
            });
        },
        methods: {
            refresh() {
                // 刷新函数
                this.scroll.refresh();
            }
        },
    }
</script>

<style  scoped>

</style>